package com.lecyon.farm.vo.view;

import com.baomidou.mybatisplus.annotation.TableField;
import com.lecyon.farm.common.constant.FarmSysConstant;
import com.lecyon.farm.util.StringHelper;
import com.lecyon.farm.vo.base.BaseViewVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * VIEW
 * </p>
 *
 * @author YaoZheng
 * @since 2020-04-02
 */
@Data
@ApiModel("农机作业历史")
public class FmWorkTotalVo extends BaseViewVo {

    private Double workLandarea;

    private Double qualifiedLandarea;

    private Double passRate;

    private Double depth;

    private Double distance;

    private String beginDate;

    private String endDate;

    /**
     * 农机号
     */
    @TableField("carId")
    private String carId;

    /**
     * 耕种类型
     */
    private String type;

    @ApiModelProperty(name = "type_dict", value = "耕种类型Dict")
    private String typeDict;

    /**
     * 车主
     */
//    @TableField("fmCar.owner")
//    private String fmCar.owner;

    /**
     * 电话
     */
//    @TableField("fmCar.ownerPhone")
//    private String fmCar.ownerPhone;

    @TableField("totalFlow")
    private Double totalFlow;

    public String getTypeDict() {
        if (StringHelper.isNotEmpty(type)) {
            boolean flag = FarmSysConstant.SYS_JOB_TYPE_MAP.containsKey(type);
            if (flag) {
                typeDict = FarmSysConstant.SYS_JOB_TYPE_MAP.get(type);
                if (StringHelper.isNotEmpty(typeDict)) {
                    return typeDict;
                }
            }
        }
        return typeDict;
    }


}
